import React from "react";
import { Navigate } from "react-router-dom";

const App = React.lazy(() => import("../App"));
// const MainLayout = React.lazy(() => import("../views/mainLayout/index"));
const Home = React.lazy(() => import("../views/home/index"));
const Login = React.lazy(() => import("../views/login/index"));
const Chats = React.lazy(() => import("../views/chats/index"));
const Videos = React.lazy(() => import("../views/videos/index"));

const mainRoutes = [
  {
    path: "home",
    element: <Home />,
  },
  {
    path: "chats",
    element: <Chats />,
  },
  {
    path: "videos",
    element: <Videos />,
  },
];

const router = [
  {
    path: "/",
    element: <Navigate to={"/home"} />,
  },
  {
    path: "/",
    element: <App />,
    children: mainRoutes,
  },
  {
    path: "/login",
    element: <Login />,
  },
];
export default router;
